@extends('backstage.layout.master')
@section('title', '修改供应商信息')
@section('style')
    <link rel="stylesheet" href="backstage/assets/css/jquery-ui-1.10.3.custom.min.css"/>
    <link rel="stylesheet" href="backstage/assets/css/chosen.css"/>
    <link rel="stylesheet" href="backstage/assets/css/datepicker.css"/>
    <link rel="stylesheet" href="backstage/assets/css/bootstrap-timepicker.css"/>
    <link rel="stylesheet" href="backstage/assets/css/daterangepicker.css"/>
    <link rel="stylesheet" href="backstage/assets/css/colorpicker.css"/>
    <style>
        .ace-file-input input[type=file] {
            position: static;
        }

        .ace-nav {
            height: 10px;
        }

        .icon-animated-bell {
            margin-top: 13px;
        }
    </style>
@stop
@section('content')
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try {
                ace.settings.check('breadcrumbs', 'fixed')
            } catch (e) {
            }
        </script>

        <ul class="breadcrumb">
            <li>
                <i class="icon-home home-icon"></i>
                <a href="backstage/home">主页</a>
            </li>

            <li class="active">
                <a href="backstage/supplier/list">供应商列表</a>
            </li>
        </ul><!-- .breadcrumb -->
    </div>
    <div class="page-content">
        <div class="row">
            <div class="col-xs-12">
                <!-- PAGE CONTENT BEGINS -->
                <form class="form-horizontal" role="form" action="/backstage/supplier/edit-supplier" method="post"
                      enctype="multipart/form-data">
                    <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
                    <input type="hidden" name="supplier_id" value="{{$detail->supplier_id}}">

                    <div class="form-group">
                        <label class="col-sm-4 control-label no-padding-right">
                            供应商名称 :</label>
                        <div class="col-sm-4">
                            <input type="text" name="supplier_name" value="{{$detail->supplier_name}}"
                                   id="supplier_name"
                                   placeholder="供应商名称"
                                   class="width-100" required="required" autocomplete="off">
                        </div>
                    </div>
                    <div class="space-4"></div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label no-padding-right">
                            联系人姓名 :</label>
                        <div class="col-sm-4">
                            <input type="text" name="supplier_contacts_name" value="{{$detail->supplier_contacts_name}}"
                                   id="supplier_contacts_name"
                                   placeholder="联系人姓名"
                                   class="width-100" required="required" autocomplete="off">
                        </div>
                    </div>
                    <div class="space-4"></div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label no-padding-right">
                            联系人电话 :</label>
                        <div class="col-sm-4">
                            <input type="text" name="supplier_mobile" value="{{$detail->supplier_mobile}}"
                                   id="supplier_mobile"
                                   placeholder="联系人电话"
                                   class="width-100" required="required" autocomplete="off" maxlength="11">
                        </div>
                    </div>
                    <div class="space-4"></div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label no-padding-right"
                               for="cat_id">供应商类型 :</label>
                        <div class="col-sm-4">
                            <select class="form-control" name="supplier_type">
                                <option value="1" @if($detail->supplier_type == 1)selected @endif>加工厂</option>
                                <option value="2" @if($detail->supplier_type == 2)selected @endif>淘宝</option>
                                <option value="3" @if($detail->supplier_type == 3)selected @endif>阿里巴巴</option>
                            </select>
                        </div>
                    </div>
                    <div class="space-4"></div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label no-padding-right"
                               for="cat_id">备注 :</label>
                        <div class="col-sm-4">
                             <textarea class="form-control" name="remark" id="remark"
                                       placeholder="备注(选填)">{{$detail->remark}}</textarea>
                        </div>
                    </div>
                    <div class="space-4"></div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right"
                               for="cat_id">请选择该供应商供应的产品模板 :</label>
                        <div class="col-sm-6">
                            <table id="sample-table-1" class="table table-striped table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th></th>
                                    <th>产品品牌名称</th>
                                    <th>产品模板名称</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($temp_lists as $list)

                                    <tr>
                                        <td class="center">
                                            <label>
                                                <input type="checkbox" value="{{$list->product_temp_id}}"
                                                       class="template_ids" name="template_ids[]"
                                                       @foreach($product_temps as $item)
                                                       @if($list->product_temp_id == $item->product_temp_id)
                                                       checked
                                                        @endif
                                                        @endforeach
                                                >
                                            </label>
                                        </td>
                                        <td>{{$list->brand_name}}</td>
                                        <td>{{$list->name}}</td>
                                    </tr>
                                @endforeach

                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="clearfix form-actions">
                        <div class="col-md-offset-5">
                            <button class="btn btn-info" id="submit" type="submit">
                                <i class="icon-ok bigger-110"></i>
                                保存
                            </button>
                            &nbsp; &nbsp; &nbsp;
                            <button class="btn" type="reset" id="reset_id">
                                <i class="icon-undo bigger-110"></i>
                                重置
                            </button>
                        </div>
                    </div>
                </form>
                <!-- PAGE CONTENT ENDS -->
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.page-content -->
@stop
@section('script')
    <script type="text/javascript">
        var _token = '{{csrf_token()}}';
    </script>
@stop